/*************************************************************************
 * @File Name: main
 * @Author: Wangjiawei
 * @Version: 1.0
 * @Mail: 2531351704@qq.com
 * @Created Time: 2023/5/16
 * @Description 球形机器人
 ************************************************************************/
#include "sys.h"

float My_Voltage;
float Pitch,Roll,Yaw;//角度
short aacx,aacy,aacz;//加速度传感器原始数据
short gyrox,gyroy,gyroz;//陀螺仪原始数据
float startYaw,targetYaw;

int main()
{
	NVIC_SetPriorityGrouping(NVIC_PriorityGroup_2);
	Delay_Init();
	Led_Init();
	OLED_Init();
	Adc_Init();
	Key_Init();
	Motor_Init();
	PWM_Init_TIM1();
	Encoder_TIM2_Init();
	Encoder_TIM3_Init();

	MPU6050_Init();           //MPU6050初始化  
    while(mpu_dmp_init())
	{
		OLED_ShowString(1,1,"Wite ...",0);
	}  
	OLED_Clear();
	
	Openmv_usart_init(9600);
	K210_usart_init(115200);
	
    MPU6050_EXTI_Init();
    oledPrint(1,1,"voltage:  ");
	oledPrint(2,1,"yaw:      ");
	oledPrint(3,1,"path:     ");
	oledPrint(4,1,"rho:      ");
	
	while(1)
	{	
		oledPrint(1,10,"%.2f ",My_Voltage);
		oledPrint(2,10,"%.2f ",Pitch);
		oledPrint(3,12,"%d   ",num[1].classid);
		oledPrint(4,12,"%d   ",num[1].num_x);
		
	}
}

